home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / MacSeparatorUI.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  73 lines

  1. /*
  2.  * @(#)MacSeparatorUI.java    1.5 98/02/06
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  *
  19.  */
  20.  
  21.  
  22. package com.sun.java.swing.plaf.mac;
  23.  
  24. import com.sun.java.swing.*;
  25. import java.awt.Color;
  26. import java.awt.Dimension;
  27. import java.awt.Graphics;
  28. import java.awt.Insets;
  29. import java.awt.Rectangle;
  30. import com.sun.java.swing.plaf.*;
  31. import java.io.Serializable;
  32.  
  33. /**
  34.  * A Mac L&F implementation of SeparatorUI.  This implementation 
  35.  * is a "combined" view/controller.
  36.  *
  37.  * @version @(#)MacSeparatorUI.java    1.0 11/24/97
  38.  * @author Symantec
  39.  */
  40.  
  41. public class MacSeparatorUI extends SeparatorUI implements Serializable
  42. {
  43.     public static ComponentUI createUI(JComponent x) {
  44.     return new MacSeparatorUI();
  45.     }
  46.     public void installUI(JComponent c) {
  47.     }
  48.     public void uninstallUI(JComponent c) {
  49.     }
  50.  
  51.     public void paint(Graphics g, JComponent c) {
  52.         Dimension s = c.getSize();
  53.  
  54.         Color oldColor = g.getColor();    // Make no net change to g
  55.  
  56.         g.setColor(MacUtilities.GrayscaleAppearance7);
  57.         g.drawLine(0, 2, s.width-1, 2);
  58.     
  59.         g.setColor(MacUtilities.GrayscaleAppearanceW);
  60.         g.drawLine(1, 3, s.width, 3);
  61.     
  62.         g.setColor(oldColor);
  63.     }
  64.  
  65.     public Dimension getPreferredSize(JComponent c) { 
  66.         return new Dimension(0, 6);
  67.     }
  68.  
  69.     public Dimension getMinimumSize(JComponent c) { return null;}
  70.     public Dimension getMaximumSize(JComponent c) { return null;}
  71.     public Insets getInsets(JComponent c) { return null;}
  72. }
  73.